package com.example.myapplicationndk.ativity;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelProviders;

import android.os.Bundle;
import android.view.View;

import com.example.myapplicationndk.R;
import com.example.myapplicationndk.bean.MyViewModel;
import com.example.myapplicationndk.bean.Student;
import com.example.myapplicationndk.databinding.ActivityHomeBinding;
import com.example.myapplicationndk.utils.GenerateString;

import org.jetbrains.annotations.NotNull;

import java.util.List;

public class HomeActivity extends AppCompatActivity {


    private ActivityHomeBinding bindingBinding;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);


        bindingBinding = DataBindingUtil.setContentView(this, R.layout.activity_home);


        Student stu = new ViewModelProvider(this).get(Student.class);

        stu.setName(GenerateString.getRandomString(10));

        bindingBinding.setStu(stu);

//        bindingBinding.setLifecycleOwner(this);


    }
}